<?php
/**
 * @copyright  For copyright and license information, read the COPYING.txt file.
 * @link       /COPYING.txt
 * @license    Academic Free License (AFL 3.0)
 * @package     default_default
 */

/** @var Mage_Adminhtml_Block_Promo_Catalog_Edit_Js $this */
?>
<script type="text/javascript">
//<![CDATA[
function hideShowSubproductOptions()
{
    if ($('rule_sub_is_enable').value == 1) {
        $('rule_sub_simple_action').up('tr').show();
        $('rule_sub_discount_amount').up('tr').show();
        $('rule_sub_discount_amount').addClassName('required-entry validate-not-negative-number');
    } else {
        $('rule_sub_simple_action').up('tr').hide();
        $('rule_sub_discount_amount').up('tr').hide();
        $('rule_sub_discount_amount').removeClassName('required-entry').removeClassName('validate-not-negative-number');
    }

    return true;
}

document.observe("dom:loaded", hideShowSubproductOptions);
//]]>
</script>
